package com.ergou.easylive.common.exception;

import com.ergou.easylive.common.enums.ResultCode;
import lombok.Getter;

/**
 * 通用业务异常，支持模块区分与业务状态码
 */
@Getter
public class BizException extends RuntimeException {
    private final ResultCode resultCode;
    private final Integer customCode;

    public BizException( ResultCode resultCode) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
        this.customCode = null;
    }

    public BizException( ResultCode resultCode, String message) {
        super(message);
        this.resultCode = resultCode;
        this.customCode = null;
    }

    public BizException( int customCode, String message) {
        super(message);
        this.resultCode = null;
        this.customCode = customCode;
    }
}


